import Vue from "vue";
import Router from "vue-router";
import Layout from "@/views/process/index.vue";

Vue.use(Router);

const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
export default new Router({
  base: "dingreport",
  mode: "history",
  routes: [
    // 后台入口
    { path: "/", redirect: "/main" },
    // 舟山大屏
    {
      path: "/main",
      name: "sunlignt",
      component: (resolve) => require(["@/views/ZSscreen/screen"], resolve),
    },
    // // ima单点登录
    // {
    //   path: "/iamSso",
    //   name: "iamSso",
    //   component: (resolve) => require(["@/views/login/iamSso"], resolve),
    // },
    // //PC端
    // {
    //   path: "/login",
    //   name: "login",
    //   component: (resolve) => require(["@/views/login/login"], resolve),
    // },
    // {
    //   path: "/apply",
    //   name: "apply",
    //   component: (resolve) => require(["@/views/login/apply"], resolve),
    // },
    // /**
    //  * 大屏
    //  */
    // // 一级大屏
    // {
    //   path: "/screen",
    //   name: "screen",
    //   component: (resolve) => require(["@/views/screen/screen"], resolve),
    // },
    // {
    //   path: "/logisticsrz",
    //   name: "sunlignt",
    //   component: (resolve) => require(["@/views/sunlignt/screen"], resolve),
    // },
    
    // // 一级大屏
    // {
    //   path: "/screen1",
    //   name: "screen1",
    //   component: (resolve) => require(["@/views/screen1/screen"], resolve),
    // },
    // {
    //   path: "/screenTest",
    //   name: "screenTest",
    //   component: (resolve) => require(["@/views/screenTest/screen"], resolve),
    // },
    // {
    //   path: "/screenSecond",
    //   name: "screenSecond",
    //   component: (resolve) => require(["@/views/screenSecond/screenSecond"], resolve),
    // },
    // {
    //   path: "/screenThird",
    //   name: "screenThird",
    //   component: (resolve) => require(["@/views/screenThird/screenThird"], resolve),
    // },
    // {
    //   path: "/screenFourth",
    //   name: "screenFourth",
    //   component: (resolve) => require(["@/views/screenFourth/screenFourth"], resolve),
    // },
    // // 后台管理
    // {
    //   path: "/manage",
    //   name: "manage",
    //   component: (resolve) => require(["@/views/manage/manage"], resolve),
    //   children: [
    //     {
    //       path: "/tables",
    //       name: "Tables",
    //       component: (resolve) => require(["@/views/manage/Tables"], resolve),
    //     },
    //     {
    //       path: "/manage",
    //       name: "dashboard",
    //       component: (resolve) => require(["@/views/manage/dashboard"], resolve),
    //     },
    //     {
    //       path: "/application",
    //       name: "Application",
    //       component: (resolve) => require(["@/views/manage/Application"], resolve),
    //     },
    //     {
    //       path: "/node",
    //       name: "Node",
    //       component: (resolve) => require(["@/views/manage/Node"], resolve),
    //     },
    //     //  测试用
    //     {
    //       path: "/demo",
    //       name: "demo",
    //       component: (resolve) => require(["@/views/demo/demo"], resolve),
    //     },
    //     //  测试用
    //     {
    //       path: "/demoEdit",
    //       name: "demo",
    //       component: (resolve) => require(["@/views/demo/demoEdit"], resolve),
    //     },
    //   ],
    // },
    // {
    //   path: "/",
    //   component: Layout,
    //   redirect: "/",
    //   children: [
    //     {
    //       path: "/port",
    //       name: "Port",
    //       component: () => import(/* webpackChunkName: "port" */ "@/views/process/Port.vue"),
    //     },
    //     {
    //       path: "/onePort",
    //       name: "OnePort",
    //       component: () => import(/* webpackChunkName: "port" */ "@/views/process/OnePort.vue"),
    //     },
    //     {
    //       path: "/oneType",
    //       name: "OneType",
    //       component: () => import(/* webpackChunkName: "port" */ "@/views/process/OneType.vue"),
    //     },
    //     {
    //       path: "/work",
    //       name: "Work",
    //       component: () => import(/* webpackChunkName: "work" */ "@/views/process/Work.vue"),
    //     },
    //     {
    //       path: "/real",
    //       name: "Real",
    //       component: () => import("@/views/process/Real.vue"),
    //     },
    //   ],
    // },
    {
      path: "/404",
      name: "404",
      component: () => import(/* webpackChunkName: "404" */ "@/views/404.vue"),
    },
    {
      path: "*",
      redirect: "/404",
    },
    // {
    //   path: "/mobile",
    //   name: "screen",
    //   component: (resolve) => require(["@/views/mobile/list"], resolve),
    // },
    // // 移动端选择组织架构
    // {
    //   path: "/organization",
    //   name: "screen",
    //   component: (resolve) => require(["@/views/mobile/organization"], resolve),
    // },
    // {
    //   path: "/mobileScreen",
    //   name: "screen",
    //   component: (resolve) => require(["@/views/mobile/mobileScreen"], resolve),
    // },
    
    // {
    //   path: "/cabinet",
    //   name: "screen",
    //   component: (resolve) => require(["@/views/mobile/cabinet"], resolve),
    // },
  ],
});
